import {
  Column,
  CreateDateColumn,
  Entity,
  PrimaryGeneratedColumn,
} from 'typeorm';

@Entity()
export class Message {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  fromUser: string;

  @Column()
  toUser: string;

  @Column()
  message: string;

  @Column()
  avatar: string;

  @Column({type: 'enum', enum: ['chat', 'send'], default: 'chat' })
  type: string;

  @Column({default:null})
  group: string;

  @CreateDateColumn()
  addTime: Date;
}
